package work.base.data.date.time;

import java.time.*;
import java.time.temporal.TemporalAdjusters;

/**
 * java.time包基本使用 Java 8的新库
 *
 */
public class LocalDateTimeTest01 {

    public static void main(String[] args) {
        // 当前日期的周一时间
        LocalDate monday = LocalDate.parse("2021-12-01").with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
        // 当前日期的周日时间
        LocalDate sunday = LocalDate.parse("2021-12-01").with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));

        System.out.println("END===");
    }
}
